/*
 * @Date: 2025-11-07 18:06:16
 * @Auth: 873768511@qq.com
 * @LastEditors: 873768511@qq.com
 * @LastEditTime: 2025-11-11 14:50:15
 * @FilePath: \corpus\src\types\systemManagement\menu.ts
 */
import type { IEnums } from '@/types/global';

export enum MenuTypeEnum {
  CAT = 'M',
  MENU = 'C',
  BTN = 'F',
}

export enum JumpWayEnum {
  CURRENT = 1,
  NEW = 0,
}

export enum DisableTypeEnum {
  ASH = 'ASH',
  DIS = 'DIS',
}

export interface ICreateCatalogRequest {
  appCode: string;
  icon: string;
  menuDesc: string;
  menuName: string;
  url: string;
}

export interface ICreOrUpdBtnRequest {
  disableType: string;
  id: number;
  menuCode: string;
  menuName: string;
}

export interface IBtnItem extends Partial<ICreOrUpdBtnRequest> {
  key: string;
}

export interface ICreateMenuRequest {
  appCode: string;
  btnList: ICreOrUpdBtnRequest[];
  hasDataPerm: boolean;
  icon: string;
  jumpWay: string;
  menuDesc: string;
  menuName: string;
  parentId: number;
  url: string;
}

export interface IUpdateCatalogRequest {
  icon: string;
  id: number;
  menuDesc: string;
  menuName: string;
  url: string;
}

export interface IUpdateMenuRequest {
  btnList: ICreOrUpdBtnRequest[];
  hasDataPerm: true;
  icon: string;
  id: number;
  jumpWay: string;
  menuDesc: string;
  menuName: string;
  url: string;
}

export interface IAppMenuDO {
  id: number;
  name: string;
  description: string;
  createTime: string;
  createBy: string;
  parentId: number;
  isFrame: 0 | 1;
  menuType: 'M' | 'C' | 'F';
  //（M目录 C菜单 F按钮）
  children: IAppMenuDO[];
  path: string;
  component: string;
  status: '0' | '1'
  orderNum: number;
  visible: '0' | '1';
  //?
  // appCode: string;
  // // children: IAppMenuDO[];
  // createNick: string;
  // disableType: IEnums<DisableTypeEnum> | string;
  // gmtCreate: string;
  // gmtModified: string;
  // hasDataPerm: boolean;
  // icon: string;
  // id: number;
  // jumpWay: IEnums<JumpWayEnum> | string;
  // key: number;
  // level: number;
  // menuCode: string;
  // menuDesc: string;
  // menuName: string;
  // menuSort: number;
  // // menuType: IEnums<MenuTypeEnum> | string;
  // modifierNick: string;
  // // parentId: number;
  // parentMenuName: string;
  // // status: string;
  // title: string;
  // url: string;
}
//菜单权限树
export interface IMenuTree {
  menuId: number;
  menuName: string;
  pageUrl: string;
  id: number;
}